<?php
allowCors();
if (!methodsRequired(['get'])) return;
if (!checkAdmin($msg)) return;

if(isset($_REQUEST["adminId"])){
    $admin_id = $_REQUEST["adminId"];
    $admin = new Admin();
    $admin->setAdminId($admin_id);
    if($_SESSION['admin']!=$admin_id&&$db->delete($admin)==1){
        $msg->setCode(0);
    }else{
        $msg->setCode(2);
    }
}else{
    $msg->setCode(2);
}
echo $msg;


